/**
 *  \file   xmac_tx.h
 *  \author Miora ANDRIAMANOHARISOA, Loic MINGHETTI
 *  \date   PFE 2011
 *  \desc	Sender thread and protocol setup
 **/

#include "msg.h"

// append data to the tranmit queue. Return -1 if tx thread is buzy and cannot process 
int xmac_tx_append(temp_data data);
// flag, true when tx thread is processing tx queue 
extern int xmac_tx_append_locked;

void tx(char* msg, int size);

// tx states
typedef enum tx_states { inactive, pending, active } tx_states;
extern tx_states tx_state;

extern unsigned int node_last_packet_id;

PT_THREAD(thread_xmac_tx(struct pt *pt));
